<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vue</title>
  </head>
  <body>
    <div id="app">
      {{ message }}
      <button @click="reverseMessage">reverse</button>
    </div>

    <script src="../vue/vue.global.js"></script>
    <script>
      // 选项式 API， 选项式
      const app = Vue.createApp({
        data() {
          return {
            message: "Hello Vue!",
          };
        },
        methods: {
          reverseMessage() {
            this.message = this.message.split("").reverse().join("");
          },
        },
        mounted() {},
      });

      app.mount("#app");
    </script>
  </body>
</html>
